<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN CONTAINER -->
	<!-- BEGIN CONTENT -->
		<!--表格操作按钮组-->
		<div>
			<a class="btn blue" href="javascript:;"  data-target="#merchantModel" 
				data-toggle="modal" ng-click="addMerchant();">
				<i class="fa fa-plus"></i>
					新增
			</a>
		</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>企业编码</th>
					<th>运营商代码</th>
					<th>企业名称</th>
					<th>运营类型</th>
					<th>结算类型</th>
					<th>服务提供商类型</th>
					<th>联系人</th>
					<th>联系电话</th>
					<th>是否使用</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="merchant in (merchantList | orderBy : '-updatedTime') track by $index  " on-loaded="{{$last}}" target-table="table_1">
					<td>
						<span ng-bind="merchant.merchantCode"></span>
					</td>
					<td>
						<span ng-bind="merchant.signalCode"></span>
					</td>
					<td>
						<span ng-bind="merchant.name"></span>
					</td>
					<td>
						<span ng-bind="merchant.isSelf | getValueInStaticFilter : 'isSelfArray'"></span>
					</td>
					<td>
						<span ng-bind="merchant.balType | getValueInStaticFilter : 'balTypeArray'"></span>
					</td>
					<td>
						<span ng-bind="merchant.providerType | getValueInStaticFilter : 'providerTypeArray'"></span>
					</td>
					<td>
						<span ng-bind="merchant.contactName"></span>
					</td>
					<td>
						<span ng-bind="merchant.telphone"></span>
					</td>
					<td>
						<span ng-bind="merchant.isValid | getValueInStaticFilter : 'validArray'"></span>
					</td>
					<td>
						<a class="btn" href="javascript:;"  data-target="#merchantModel" 
						data-toggle="modal" ng-click="updateMerchant(merchant);">
							修改
						</a>
					</td>
				</tr>
			</tbody>
			</table>
		
		<div id="merchantModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						<h4 class="modal-title">服务提供商新增/修改</h4>
					</div>
					<div class="modal-body form">
						<div class="form-group">
							<div class="row">
								<label class="col-sm-3 control-label text-right">企业名称</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate" id="merchantNameInput"
										key="required,maxlength_50" ng-model="selectedMerchant.name"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">企业简称</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="required,maxlength_16" ng-model="selectedMerchant.shortName"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">企业地址</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control  bValidate" ng-model="selectedMerchant.address  "  key="maxlength_80" />
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">邮政编码</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate"  key="maxlength_6"  ng-model="selectedMerchant.post"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">企业法人</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="required ,maxlength_18" ng-model="selectedMerchant.owner"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">法人身份证</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="maxlength_18" ng-model="selectedMerchant.idNo"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">联系电话</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control  bValidate"  key="tel"  ng-model="selectedMerchant.telphone"/>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">联系人</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate"  key="maxlength_20"  ng-model="selectedMerchant.contactName"/>
									</div>
								</div>
							</div>
							<div class="row" ng-if="selectedMerchant.providerType==0">
								<label class="col-sm-3 control-label text-right">运营商代码</label>
								<div class="col-sm-9">
									<div class="input-group">
										<!-- 添加change事件判断当前运营商代码是否重复 -->
										<input type="text" class="form-control bValidate"  key="maxlength_3,number"  ng-model="selectedMerchant.signalCode" ng-blur="checkMerchantSignalCode(selectedMerchant);"/>
									</div>
								</div>
							</div>
							<div class="row"  >
								<label class="col-sm-3 control-label text-right">支付宝账号</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate" key="maxlength_20"  ng-model="selectedMerchant.alipay"/>
									</div>
								</div>
							</div>
							<div class="row" >
								<label class="col-sm-3 control-label text-right">Email</label>
								<div class="col-sm-9">
									<div class="input-group">
										<input type="text" class="form-control bValidate"  key="email" ng-model="selectedMerchant.email"/>
									</div>
								</div>
							</div>
							<hr />
							<div class="row">
								<label class="col-sm-3 control-label text-right">运营类型</label>
								<div class="col-md-9">
									<div class="radio-list">
										<label class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.isSelf" type="radio"  value="1" 
											class="bValidate" key="required" name="isSelf" 
											ng-selected="selectedMerchant.isSelf==1">
												自营
										</label>
										<label class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.isSelf" type="radio"  value="0" 
											ng-selected="selectedMerchant.isSelf==0" name="isSelf">
												非自营
										</label>
									</div>
								</div>
							</div>
							<!-- <div class="row">
								<label class="col-sm-3 control-label text-right">自动转账</label>
								<div class="col-md-9">
									<div class="radio-list">
										<label class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.transmatic" type="radio"  value="1" 
											class="bValidate" key="required" name="transmatic" 
											ng-selected="selectedMerchant.transmatic==1">
												是
										</label>
										<label class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.transmatic" type="radio"  value="0" 
											ng-selected="selectedMerchant.transmatic==0" name="transmatic">
												否
										</label>
									</div>
								</div>
							</div> -->
							<div class="row">
								<label class="col-sm-3 control-label text-right">服务提供商类型</label>
								<div class="col-md-9">
									<div class="radio-list">
										<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.providerType" type="radio"  value="0" 
											class="bValidate" key="required" name="providerType" 
											ng-selected="selectedMerchant.providerType==0">
												运营商 
										</label>
										<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.providerType" type="radio"  value="2" 
											ng-selected="selectedMerchant.providerType==2" name="providerType">
												合作商
										</label>
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.providerType" type="radio"  value="3" 
											ng-selected="selectedMerchant.providerType==3" name="providerType">
												虚拟合作商
										</label>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">结算类型</label>
								<div class="col-md-9">
									<div class="radio-list">
										<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.balType" type="radio"  value="1" 
											class="bValidate" key="required" name="balType" 
											ng-selected="selectedMerchant.balType==1">
												实时转账
										</label>
										<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.balType" type="radio"  value="0" 
											ng-selected="selectedMerchant.balType==0" name="balType">
												周期结算
										</label>
									</div>
								</div>
							</div>
							<div class="row">
								<label class="col-sm-3 control-label text-right">是否启用</label>
								<div class="col-md-9">
									<div class="radio-list">
										<label  class="radio-inline col-md-4 " style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.isValid" type="radio"  value="1" 
											ng-selected="selectedMerchant.isValid==1">
												启用
										</label>
										<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
											<input ng-model="selectedMerchant.isValid" type="radio"  value="0" 
											ng-selected="selectedMerchant.isValid==0">
												停用
										</label>
									</div>
								</div>
							</div>
							<hr />
							<div class="row">
								<label class="col-sm-3 control-label text-right">区/县选择</label>
								<div class="col-sm-9">
									<div class="input-group">
										<district-select country-list="countryMap" province-map="provinceMap"
										city-map="cityMap" district-map="districtMap" selected-item='selectedItem' 
										modify-type='modifyType'>
										</district-select>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
						<button type="button" class="btn btn-primary" ng-click="modifyMerchant();"><i class="fa fa-check"></i>保存</button>
					</div>
				</div>
			</div>
		</div>
		

</div>
	<!-- END CONTENT -->

<!-- END CONTAINER -->

<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->



</body>
<!-- END BODY -->
</html>
<script src="manageView/assets/scripts/public.js" type="text/javascript"></script>
